package com.cloud.system.api.mapper;

import com.cloud.system.api.entity.NoticeReadHuman;
import com.cloud.system.common.utils.BaseMapperHelper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

public interface NoticeReadHumanMapper extends BaseMapperHelper<NoticeReadHuman> {

    @Delete("delete from notice_read_human where notice_id = #{noticeId}")
    void deleteByNoticeId(int noticeId);

    @Select("select count(*) from notice_read_human where human_id = #{humanId} and notice_id = #{noticeId}")
    @ResultType(Integer.class)
    int selectNumById(@Param("humanId") Long humanId, @Param("noticeId") int noticeId);
}
